﻿Public Class frmLTD
    Dim ctx As New QLDBDataContext
    Dim _ltd As New dsLTD
    Dim _vd As New dsVong
    Dim _clb As New dsCLB
    Dim _tk As New TimKiem
    Private Sub btnChinhSua_Click(sender As Object, e As EventArgs) Handles btnChinhSua.Click

    End Sub

    Private Sub btnDong_Click(sender As Object, e As EventArgs) Handles btnDong.Click
        Close()
    End Sub

    Private Sub frmTaoLTD_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        dgvLTD.DataSource = _tk.TimKiemLTD(1, 0)

        'Load vong dau vao combobox
        cbVong.DataSource = _vd.LayDSVong()
        cbVong.DisplayMember = 0
        cbVong.ValueMember = "Vong"

        'Load clb vao combobox
        cbCLB.DataSource = _clb.LayDoiBongTK()
        cbCLB.DisplayMember = "TenCLB"
        cbCLB.ValueMember = "MaCLB"


    End Sub
    Dim _vongIndex, _clbIndex As Integer
  
    Private Sub cbVong_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles cbVong.SelectionChangeCommitted, cbCLB.SelectionChangeCommitted
        _vongIndex = cbVong.SelectedValue
        _clbIndex = cbCLB.SelectedValue
        dgvLTD.DataSource = _tk.TimKiemLTD(_vongIndex, _clbIndex)
    End Sub
End Class